<!DOCTYPE html>
<html lang='en'>
<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>
</head>
<body>
    <div id='app'>

        <div v-if='age>22'>我是成年人22</div>
       
        <div v-else-if='age>33'>我是成年人33</div>
        <div v-else>我是未成年人</div>
        {{msg}}

        <div v-if='flag'>我司v-if</div>
        <div v-show='flag2'>我司v-show</div>

        <input type="button" value="if&show的切换显示" @click='btn'>
    </div>
    <script type='text/javascript'>
        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'Hello Vue',
                flag:true,
                flag2:false,
                age:22
            },
            methods:{
                btn(){
                    this.flag=!this.flag
                    this.flag2=!this.flag2
                    this.age=34
                }
            }
        });
    </script>
</body>
</html>